package cvo.pro4.chess.client.entities;
 

 
 
public class Tile {
    private BoardCoordinates boardCoordinates;
    private Color color;
    private Boolean isOccupied;
    
    
    public Tile(BoardCoordinates boardCoordinates, Color color){
        this.boardCoordinates = boardCoordinates;
        this.color = color;
        this.isOccupied = false;
    }
    
    public BoardCoordinates getCoordinates(){
        return this.boardCoordinates;
    }
    public Color getColor(){
        return this.color;
    }

	/**
	 * Is there already a Piece on this Tile?
	 * @return Boolean yes or no
	 */
	public Boolean getIsOccupied() {
		return isOccupied;
	}

	public void setIsOccupied(Boolean isOccupied) {
		this.isOccupied = isOccupied;
	}
	
	/**
	 * A tile is the same as an other Tile if it coordinates are the same
	 */
	@Override
	public boolean equals(Object o){
		if(o instanceof Tile){
			Tile other = (Tile)o;
				if(this.boardCoordinates.equals(other.boardCoordinates)){
					return true;
				}
		}
		return false;		
	}


	@Override
	public String toString() {
		return "Tile [boardCoordinates=" + boardCoordinates + ", color=" + color + "]";
	}

	
}
